﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        public static Dictionary<string, string> users = new Dictionary<string, string>();
        private void button1_Click(object sender, EventArgs e)
        {
            string name = textBox1.Text;
            string paword = textBox2.Text;
            var usr = users.Where(x => x.Key == name && x.Value == paword).Select(x => new { key = x.Key, value = x.Value }).FirstOrDefault();
            if (name.Equals("") && paword.Equals(""))
            {
                MessageBox.Show("账号或密码不能为空");
            }
            else if (usr != null)
            {
                MessageBox.Show("成功");
                Form2 form2 = new Form2();
                this.Hide();
                form2.Show();
            }
            else
            {
                MessageBox.Show("失败");
                textBox1.Text = "";
                textBox2.Text = "";
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Form3 form3 = new Form3();
            this.Hide();
            form3.Show();
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }
    }
}
